Protection from side-channel attacks by varying clock delays

ABSTRACT

A system, comprising a logic circuit and delay circuitry, is described. The logic circuit is configured to perform a plurality of instances of a particular computation that is based on a plurality of inputs. The delay circuitry is configured to vary a power-consumption profile of the logic circuit over the plurality of instances, by applying, to the inputs, respective delays that vary over the instances, at least some of the delays varying independently from each other. Other embodiments are also described.

FIELD OF THE INVENTION

Embodiments of the present invention relate generally to the field of data security, and more specifically, to protection from side-channel attacks.

BACKGROUND

In certain side-channel attacks, information relating to the timing and/or power consumption of computations may be used to compromise the security of a secure data system.

US Patent Application Publication 2012/0204056, whose disclosure is incorporated herein by reference, describes a data processing apparatus that is configured to perform a data processing operation on at least one data value in response to a data processing instruction. The data processing apparatus comprises a delay unit situated on a path within the data processing apparatus, wherein the delay unit is configured to apply a delay to propagation of a signal on the path and. propagation of that signal forms part of the data processing operation. The data processing apparatus is configured to determine a result of the data processing operation at a predetermined time point, wherein the predetermined time point following an initiation of the data processing operation by a predetermined time interval. The delay unit is configured such that a time for the data processing operation to be performed plus the delay is less than the predetermined time interval.

US Patent Application Publication 2011/0285421, whose disclosure is incorporated herein by reference, describes a technique and method for reducing ability to monitor the relationship between currents in the system and the data in the system by closing the overall clock eye diagram, whilst keeping the eye diagram for connected stages open. The degree of eye closure for connected pipeline stages allows the system to run closer to its maximum operating speed compared to the use of system wide clock jitter, yet the overall closure provides security that is absent from systems with a partially open eye.

U.S. Pat. No. 8,427,194, whose disclosure is incorporated herein by reference, describes a technique and methods for reducing the ability of an intruder to monitor the relationship between currents in the system and the data in the system through the use of a randomized clock wherein the clock eye diagram is closed and without significant reduction in maximum operating speed compared to the reduction in maximum operating frequency that occurs when using conventional means of additive jitter.

SUMMARY OF THE INVENTION

There is provided, in accordance with some embodiments of the present invention, a system that includes a logic circuit, configured to perform a plurality of instances of a particular computation that is based on a plurality of inputs. The system further includes delay circuitry configured to vary a power-consumption profile of the logic circuit over the plurality of instances, by applying, to the inputs, respective delays that vary over the instances, at least some of the delays varying independently from each other.

In some embodiments, each one of the delays varies independently from each other one of the delays.

In some embodiments, each one of the delays varies between two values.

In some embodiments, the delay circuitry is configured to vary the power-consumption profile of the logic circuit over the plurality of instances by causing a variation, over the instances, in intermediate output values that are computed by the logic circuit.

In some embodiments, the delay circuitry is configured to vary the power-consumption profile of the logic circuit over the plurality of instances by causing a variation, over the instances, in respective timings of computations performed by the logic circuit.

In some embodiments, the system further includes a plurality of flip-flops, each one of the inputs being from a respective one of the flip-flops.

In some embodiments, the system further includes a register that includes the flip-flops.

In some embodiments, the delay circuitry includes a plurality of delay circuits, each one of the delay circuits being configured to apply a respective one of the delays to a respective one of the inputs by:

delaying a clock signal by the respective one of the delays, such as to yield a delayed clock signal, and

feeding the delayed clock signal to a respective one of the flip-flops.

In some embodiments, each one of the delay circuits is configured to delay the clock signal by a duration that is a function of a respective generated random delay bit.

In some embodiments, the system further includes one or more other logic circuits having respective propagation delays and connected in series with the logic circuit, and the delay circuitry is configured to apply the respective delays to the inputs such that a total propagation delay of the logic circuit does not exceed, in any one of the instances, a maximum one of the respective propagation delays of the other logic circuits.

There is further provided, in accordance with some embodiments of the present invention, a method. The method includes, using a logic circuit, performing a plurality of instances of a particular computation that is based on a plurality of inputs. The method further includes varying a power-consumption profile of the logic circuit over the plurality of instances, by applying, to the inputs, respective delays that vary over the instances, at least some of the delays varying independently from each other.

The present invention will be more fully understood from the following detailed description of embodiments thereof, taken together with the drawings, in which:

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic high-level illustration of a system for protecting against side-channel attacks, in accordance with some embodiments of the present invention;

FIG. 2 is a schematic illustration of an example embodiment of the system of FIG. 1, in accordance with some embodiments of the present invention; and

FIGS. 3A-B are schematic illustrations of respective timelines for operation of the system of FIG. 1, in accordance with some embodiments of the present invention.

DETAILED DESCRIPTION OF EMBODIMENTS OVERVIEW

Some side-channel attacks exploit the consistency in the power-consumption profile of a system, to gain unauthorized access to information from within the system. For example, a side-channel attack may be used to break the encryption of a cryptosystem, thus gaining access to information from within the cryptosystem.

Embodiments of the present invention protect against such side-channel attacks, by “randomizing” the power-consumption profile of the system. To achieve this randomization, random delays (i.e., delays whose durations vary randomly are applied to the inputs of at least one logic circuit belonging to the system. Due to these delays, the manner in which the logic circuit performs any particular computation will vary between instances of the computation. For example, the random delays may cause the logic circuit to compute, prior to computing the final output value, intermediate outputs that change, in value and/or timing, as a function of the random delays. Hence, the power-consumption profile of the logic circuit will vary between instances of any particular computation, at least due to (i) the varying intermediate output values computed by the logic circuit, and (ii) the varying timing of the computations performed by the logic circuit.

Alternatively or additionally, random delays may be applied to at least one memory element (such as a register of flip-flops) within the system, thus causing the power-consumption profile of the memory element to vary between instances of any particular computation, by varying the times at which the memory element is updated. In some cases, inputs to a logic circuit are received from a memory element, such that delays applied to the memory element affect the power consumption of both the memory element and the logic circuit.

In the context of the present application, including the claims, a “logic circuit” is any electronic circuit that computes an output by performing a logical operation on input values. (Such a logical operation is typically a combination of the basic NOT, AND, OR, NAND, NOR and XOR operations.) The output of the logic circuit may be a pure function only of the present input to the circuit, in which case the logic circuit is referred to a “combinational-logic circuit” or “combinatorial-logic circuit.” Alternatively, the output may depend on the history of the input to the circuit and/or on a previous output, in which case the logic circuit is referred to a “sequential-logic circuit.” Embodiments described herein may be applied to both combinational-logic circuits and sequential-logic circuits.

In the context of the present application, including the claims, the “power-consumption profile” of a system or circuit refers to the amount of power consumed by the system or circuit as a function of time. Moreover, references to “varying a power-consumption profile” refer to varying the amount of power consumed by the system or circuit at at least one instant in time, by more than a normal amount of statistical variation. In other words, even though variation in temperature, voltage, and/or other factors may cause a power-consumption profile to exhibit a normal amount of statistical variation, such variation is “canceled out” in a side-channel attack. Embodiments described herein, on the other hand, vary the power-consumption profile by more than this normal amount, thus foiling any potential side-channel attack.

SYSTEM DESCRIPTION

Reference is initially made to FIG. 1, which is a schematic high-level illustration of a system 20 for protecting against side-channel attacks, in accordance with some embodiments of the present invention. System 20 is shown as a component of a card reader 23, which is used for reading a smart card 25. Notwithstanding this particular embodiment, however, it is noted that system 20 may also be implemented on any other suitable type of apparatus. For example, system 20 may be implemented on smart card 25, or, more generally, on any device that implements digital logic, such as a central processing unit (CPU) in any stationary or mobile computer.

FIG. 1 shows, at a high schematic level, the flow of data into, within, and from system 20. First, encrypted data “ED” from smart card 25 is received by system 20. Such data may, for example, be received by a first register (“R”) 21 a. Subsequently, the data may flow to a first logic circuit (“C”) 22 a, which may compute an output from the data. The output may then be fed back to first register 21 a, and/or to a second register 21 b, from which it may subsequently flow to a second logic circuit 22 b. The data may continue to pass through any number of registers and logic circuits, each of the logic circuits performing any relevant operations on the data, in response to any relevant additional inputs. Finally, system 20 outputs unencrypted data “UD, ” which may be used, for example, to perform a financial transaction.

FIG. 1 also shows an oscilloscope 29, poised to carry out a side-channel attack on card reader 23 by monitoring the power input 27 to the card reader. As further described below, system 20 is configured to foil such an attack, by varying the power-consumption profile of the card reader from one card readout operation to another. (In some cases, an attacker may alternatively or additionally attempt to illicitly extract data by monitoring the power consumption of smart card 25. The implementation of system 20 on the smart card, as described above, may help foil such an attack.)

Reference is now made to FIG. 2, which is a schematic illustration of an example embodiment of system 20, in accordance with some embodiments of the present invention. For sake of illustration, FIG. 2 shows a simple example, in which the cascade of registers and logic circuits shown in FIG. 1 is replaced with a single register 21 and single logic circuit 22, which, as described below, performs an addition operation on the data from register 21. It is noted, however, that the principles and techniques described with reference to FIG. 2 may be similarly applied to other systems having much higher levels of complexity.

Register 21 comprises a plurality of flip-flops, indicated in FIG. 2 by reference numerals F3, F2, F1, and F0. At any given time, each of the flip-flops stores a single binary value. It is assumed throughout the present description that flip-flop F3 stores the highest-order bit, flip-flop F2 the next-highest-order bit, etc. For example, when (i) F3 and F1 store 0, and (ii) F2 and F0 store 1, register 21 will store the value 0101 (=5). Given that, as further described below, the example embodiment of FIG. 2 implements a counter, the value stored in the register may be referred to as the value of a “COUNT” variable.

FIG. 2 shows F3 receiving a clock signal C3, F2 receiving a clock signal C2, F1 receiving a clock signal C1, and F0 receiving a clock signal C0. Upon the rising (or, alternatively, falling) edge of each respective clock signal, the corresponding flip-flop captures (“latches”) the value of a respective data input D. After a short delay, the captured value becomes output Q of the flip-flop, this output being subsequently input to logic circuit 22. Thus, FIG. 2 shows the output from flip-flop F3 being fed to the logic circuit as an input 13, the output from flip-flop F2 being fed to the logic circuit as an input I2, the output from flip-flop F1 being fed. to the logic circuit as an input I1, and the output from flip-flop F0 being fed to the logic circuit as an input I0.

Logic circuit 22 performs a logical operation on the inputs. In particular, in FIG. 2, logic circuit 22 is a counter that performs a “+1” operation, in which 1 is added to the input to the logic circuit. This operation yields an output NEXT COUNT (or “NC”) that includes four output bits NC3, NC2, NC1, and NC0. In the present description, NC3 is assumed to be the highest-order bit of NEXT COUNT, NC2 the next-highest-order bit, etc. Each output bit is fed to the flip-flop corresponding to the order of magnitude of the output bit, such that, during the next clock cycle, COUNT acquires the value of NEXT COUNT.

Thus, for example, an initial COUNT of 0001 may be input to the logic circuit. (This means that I0=1, while I1=I2=I3=0.) By performing the “+1” operation, the logic circuit computes an output NEXT COUNT of 0010. (This means that NC1=1, while NC0=NC2=NC3=0.) This output is then fed back to the flip-flaps, such that, during the next clock cycle, flip-flop F1 captures the value 1, while the remainder of the flip-flops capture the value 0, i.e., COUNT is incremented to 0010. This new value of COUNT is then input to the logic circuit.

As noted above, many details shown in FIG. 2 are provided by way of illustration only. In practice, embodiments of the present invention may be applied to any suitable number of logic circuits, each of which may perform any suitable operation. Each logic circuit may receive any number of inputs, including, for example, inputs that are received from sources other than memory elements within the system, and may calculate any number of outputs. Such outputs may be fed to memory elements as shown, and/or may be used in any other way. Moreover, system 20 may comprise any suitable number of memory elements of any suitable type.

To protect against side-channel attacks, embodiments of the present invention delay the clock signals to the flip-flops by respective durations that vary between instances of any particular computation. The delays to the clock signals cause a variation in the times at which the flip-flops capture their new respective values, thus varying the power-consumption profile of the flip-flops. Moreover, since the inputs to the logic circuit are received from the flip-flops, the clock-signal delays have the further effect of varying the power-consumption profile of the logic circuit. Thus, the power-consumption profile of the system as a whole is varied, due to variation in both the power-consumption profile of the flip-flops and the power-consumption profile of the logic circuit. (Notwithstanding the above, it is noted that the scope of the present invention includes varying the power-consumption profile of one or more logic circuits, as described herein, without varying the power-consumption profile of any memory elements.)

At least some of the delays vary independently from each other; for example, as shown in FIG. 2 and further described below, each of the delays may vary independently from each of the other delays. In some embodiments, as further described immediately below with reference to FIG. 2, system 20 may randomly delay each clock signal by one of two delay durations. In such a case, assuming four flip-flops as shown, there are 2⁴=16 different power-consumption profiles for each possible calculation that the logic circuit may perform. In more complex systems, having a greater number o flip-flops and/or circuits, there may be millions or billions of power-consumption profiles, such that successfully conducting a side-channel attack becomes virtually impossible. For example, with 32 flip-flops, and assuming only two delay duration the number of different power-consumption profiles is greater than 4 billion.

In some embodiments, delay circuits 26 are used to delay the clock signals received by the flip-flops. For example, as shown in FIG. 2, a common CLOCK signal may be fed to each of a plurality of delay circuits 26. Each delay circuit receives the CLOCK signal, delays the CLOCK signal, and then feeds the delayed signal to a respective one of the flip-flops.

In some embodiments, each delay circuit delays the CLOCK signal in response to a random delay bit “RDB,” which is generated independently from the random delay bits fed to the other delay circuits. (In FIG. 2, the random delay bits are indicated by reference numerals RDB3, RDB2, RDB1, and RDB0, corresponding, respectively, to F3, F2, F1, and F0.) In response to the random delay bit, a multiplexer 28 may activate one of two delay elements “Delay 1” and “Delay 2,” such that the CLOCK signal is delayed by one of two delay durations. For example, multiplexer 28 may select “Delay 1” in response to RDB=0, and “Delay 2” in response to RDB =1. In this manner, the delay for each flip-flop varies in a random manner.

Notwithstanding the particular embodiment described above, it is noted that the scope of the present invention includes the use of any suitable circuitry to delay the inputs to the logic circuit, and/or delay the times at which memory elements within the system are updated.

The effect of the random delays applied to the clock signals is demonstrated in FIGS. 3A-B, which are schematic illustrations of respective timelines for operation of system 20, in accordance with some embodiments of the present invention. FIGS. 3A-B are based on the embodiment of system 20 shown in FIG. 2.

A first scenario is shown in FIG. 3A. In this first scenario, the initial value of COUNT stored in the register is 0001, while NEXT COUNT initially has the value 0010 (which, per the “+1” operation, is 1 greater than. COUNT). At time T0, CLOCK goes from low to high. Due to the delay circuits, however, the register does not immediately capture the value 0010, but rather, first captures an intermediate value 0011. In particular, (i) the delay circuits for F3 and F1 each delay CLOCK by a duration of zero (e.g., by applying a “Delay 1” of zero), such that clock signals C3 and C1 go from low to high at time T0, but (ii) the delay circuits for F2 and F0 delay CLOCK by a greater duration, such that clock signals C2 and C0 go from low to high only at a later time T1. (For example, these latter delay circuits may apply a “Delay 2” of T1-T0.) Thus, at T0, F3 and F1 capture, respectively, bits NC3 and NC1 from NEXT COUNT, but F2 and F0 retain their previous values, such that COUNT=0011.

Sometime after T0, the logic circuit receives the new input 0011. The logic circuit then begins to operate on 0011. First, at time T2, the logic circuit outputs an intermediate output of 0110. This output is “between” the initial output value of 0010 and the “target” output value of 0100 (which is 1 greater than the input 0011), in that the logic circuit has set NC3 to 1, but has not yet set NC1 to 0.

As noted above, at time T1, prior to T2, F2 and F0 capture, respectively, the values of NC2 and NC0, such that the value stored in the register changes to 0010. Subsequently, sometime after T1, the logic circuit receives the input 0010 from the register, and begins to process the input. First, at time T3, the logic circuit outputs the intermediate value 0111, which is “between” the previous output 0110 and the “target” output 0011, in that the logic circuit has set NC0 to 1, but has not yet set NC3 to 0. Subsequently, at time T4, the logic circuit outputs the final output 0011.

Typically, system 20 is configured such that each of the clock-signal delays is shorter than the time required for the logic circuit to finish its first computation. Thus, for example, in FIG. 3A, the final update to COUNT occurs at T1, before the first change to NEXT COUNT at T2. (If any one of the clock signals were to be delayed beyond T2, the register would capture the incorrect value 0110, instead of 0010.)

A second scenario is shown in FIG. 3B. In this second scenario, the initial states of COUNT and NEXT COUNT are the same as in FIG. 3A, and the logic circuit performs the identical “+1” computation_(—) However, due to the different delays applied to the clock signal inputs to the flip-flops, the manner in which the computation proceeds is markedly different.

First, at T0, F2 and F0 capture their new respective values, such that the register stores the intermediate value 0000. The logic circuit then begins to process this intermediate input. Then, at T1, F3 and F1 capture their new respective values, such that COUNT changes to 0010. The logic circuit, however, continues to operate on the intermediate input value 0000. Thus, at time T2, the logic circuit outputs an intermediate value 0011. (This value is “between” 0010 and the “target” output 0001, in the sense described above; incidentally, this value happens to be the same as the final output.) Then, at time T3, the logic circuit outputs the value 0001, which is the final result of applying the “+1” operation to the intermediate input 0000. Finally, at time T4, the logic circuit outputs 0011, which is the final result of applying the “+1” operation to the final input 0010.

It thus emerges that FIG. 3B differs from FIG. 3A in at least two ways, due to the different intermediate input value (0000 vs. 0011) passed to the logic circuit. First, as noted above, the logic circuit computes different intermediate output values (0011 and 0001 vs. 0110 and 0111). Second, the timing of the computations performed by the logic circuit is different. Thus, for example, FIG. 3B shows the T3 transition in the value of NEXT COUNT occurring earlier, and the final T4 transition occurring later, than in FIG. 3A. Due to these differences, the power-consumption profile of the logic circuit is different for FIG. 3B than for FIG. 3A, as indicated by the different (purely illustrative) power-consumption plots shown in the figures.

In some cases, changing the intermediate input values may further cause the number of intermediate output values to change. The change in the number of intermediate output values is yet another factor that may affect the power-consumption profile.

(It is noted that the intermediate output values shown in the figures were chosen to be “in-between values” for the sake of illustration only. In the context of the present application, including the claims, an “intermediate output value” may be any value that is output by the logic circuit prior to outputting the final result of the computation.)

Typically, as noted above, system 20 comprises a plurality of logic circuits connected in series with each other. For such multi-circuit systems, typically (but not necessarily), clock delays are applied only to the inputs of the faster ones of these circuits, in order to ensure that the overall speed of the system is no less than it would have been without the delays.

For example, if the slowest logic circuit in a CPU has a propagation delay of 9.9 nanoseconds, the duration of the clock cycle of the CPU may be set to 10 nanoseconds. (This corresponds to a clock speed of approximately 100 MHz; 100 million is slightly less than the number of calculations per second that the slowest logic circuit can perform.) Therefore, in order to maintain the duration of the clock cycle at 10 nanoseconds, delays may be applied only to the inputs of those circuits whose total propagation delays (including the clock delays) are less than 10 nanoseconds, with a sufficient margin of safety. For example, the clock delays may be set such that no total propagation delay in the system exceeds the “baseline” propagation delay of 9.9 nanoseconds. Thus, by way of illustration, a circuit having an initial propagation delay of 8 nanoseconds may have one or more inputs delayed by any suitable duration that does not exceed 1.9 nanoseconds. Alternatively or additionally, another circuit having an initial propagation. delay of 7 nanoseconds may have one or more inputs delayed by any suitable duration that does not exceed 2.9 nanoseconds.

(In the context of the present application, including the claims, the “propagation delay” of a logic circuit is the time required for the circuit to output the result of a computation, measured from the time of receipt of the input.)

It will be appreciated by persons skilled in the art that the present invention limited to what has been particularly shown and described hereinabove. Rather, the scope of embodiments of the present invention includes both combinations and subcombinations of the various features described hereinabove, as well as variations and modifications thereof that are not in the prior art, which would occur to persons skilled in the art upon reading the foregoing description. Documents incorporated by reference in the present patent application are to be considered an integral part of the application except that to the extent any terms are defined in these incorporated documents in a manner that conflicts with the definitions made explicitly or implicitly in the present specification, only the definitions in the present specification should be considered. 

1. A system, comprising: a logic circuit, configured to perform a plurality of instances of a particular computation that is based on a plurality of inputs; and delay circuitry configured to vary a power-consumption profile of the logic circuit over the plurality of instances, by applying, to the inputs, respective delays that vary over the instances, at least some of the delays varying independently from each other.
 2. The system according to claim 1, wherein each one of the delays varies independently from each other one of the delays.
 3. The system according to claim 1, wherein each one of the delays varies between two values.
 4. The system according to claim 1, wherein the delay circuitry is configured to vary the power-consumption profile of the logic circuit over the plurality of instances by causing a variation, over the instances, in intermediate output values that are computed by the logic circuit.
 5. The system according to claim 1, wherein the delay circuitry is configured to vary the power-consumption profile of the logic circuit over the plurality of instances by causing a variation, over the instances, in respective timings of computations performed by the logic circuit.
 6. The system according to claim 1, further comprising a plurality of flip-flops, each one of the inputs being from a respective one of the flip-flops.
 7. The system according to claim 6, further comprising a register that comprises the flip-flops.
 8. The system according to claim 6, wherein the delay circuitry comprises a plurality of delay circuits, each one of the delay circuits being configured to apply a respective one of the delays to a respective one of the inputs by: delaying a clock signal by the respective one of the delays, such as to yield a delayed clock signal, and feeding the delayed clock signal to a respective one of the flip-flops.
 9. The system according to claim 8, wherein each one of the delay circuits is configured to delay the clock signal by a duration that is a function of a respective generated random delay bit.
 10. The system according to claim 1, further comprising one or more other logic circuits having respective propagation delays and connected in series with the logic circuit, wherein the delay circuitry is configured to apply the respective delays to the inputs such that a total propagation delay of the logic circuit does not exceed, in any one of the instances, a maximum one of the respective propagation delays of the other logic circuits. 11 A method, comprising: using a logic circuit, performing a plurality of instances of a particular computation that is based on a plurality of inputs; and varying a power-consumption profile of the logic circuit over the plurality of instances, by applying, to the inputs, respective delays that vary over the instances, at least some of the delays varying independently from each other.
 12. The method according to claim 11, wherein each one of the delays varies independently from each other one of the delays.
 13. The method according to claim 11, wherein each one of the delays varies between two values.
 14. The method according to claim 11, wherein the applying of the respective delays to the inputs varies the power-consumption profile of the logic circuit over the plurality of instances by causing a variation, over the instances, in intermediate output values that are computed by the logic circuit.
 15. The method according to claim 11, wherein the applying of the respective delays to the inputs varies the power-consumption profile of the logic circuit over the plurality of instances by causing a variation, over the instances, in respective timings of computations performed by the logic circuit.
 16. The method according to claim 11, wherein the inputs are inputs from respective flip-flops.
 17. The method according to claim 16, wherein the flip-flops belong to a register of flip-flops.
 18. The method according to claim 16, wherein applying the respective delays to the inputs comprises applying the respective delays to the inputs by: feeding a clock signal to a plurality of delay circuits, using the delay circuits, delaying the clock signal, such as to yield a plurality of delayed clock signals, and feeding, to each of the flip-flops, a respective one of the delayed clock signals.
 19. The method according to claim 18, wherein, for each delay circuit of delay circuits, delaying the clock signal comprises: generating a random delay bit, and using the delay circuit, delaying the clock signal by a duration that is a function of the random delay bit.
 20. The method according to claim 11, wherein the logic circuit is connected in series with one or more other logic circuits having respective propagation delays, and wherein applying the delays to the inputs comprises applying the delays to the inputs such that a total propagation delay of the logic circuit does not exceed, in any one of the instances, a maximum one of the respective propagation delays of the other logic circuits. 